﻿<navigation:Page 
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:InsuranceAdjuster_DesignModels="clr-namespace:InsuranceAdjuster.DesignModels" 
     xmlns:helpers="clr-namespace:InsuranceAdjuster.Helpers"
  xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
    xmlns:System="clr-namespace:System;assembly=mscorlib" 
    xmlns:Controls="clr-namespace:InsuranceAdjuster.Controls"
    xmlns:common="clr-namespace:Papa.Common;assembly=Papa.Common"
    x:Class="InsuranceAdjuster.Views.IncidentView"
    mc:Ignorable="d"
    d:DesignWidth="937" d:DesignHeight="600"   
    DataContext="{Binding Path=Claim, Source={StaticResource Locator}}"
    helpers:Navigator.Source="{Binding}"
    Width="1000" Height="660"
    >
    <navigation:Page.Resources>
        <Style x:Key="DamageButton" TargetType="HyperlinkButton">
            <Setter Property="Foreground" Value="#FF73A9D8"/>
            <Setter Property="Padding" Value="2,0,2,0"/>
            <Setter Property="Cursor" Value="Hand"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="Background" Value="{StaticResource YellowBrush}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="HyperlinkButton">
                        <Grid Background="{TemplateBinding Background}" Cursor="{TemplateBinding Cursor}">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="UnderlineTextBlock">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="UnderlineTextBlock">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DisabledOverlay">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualElement"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Rectangle Margin="0" StrokeThickness="1" Fill="{StaticResource YellowBrush}"/>
                            
                            <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Margin="0" d:LayoutOverrides="Height"/>
							
							<Rectangle x:Name="DisabledOverlay" Margin="0" Opacity="0.5" StrokeThickness="1" Fill="#AAA" Visibility="Collapsed" />
							
							
                            <TextBlock x:Name="UnderlineTextBlock" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Text="{TemplateBinding Content}" TextDecorations="Underline" Visibility="Collapsed" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            <TextBlock x:Name="DisabledOverlay2" Foreground="#FFAAAAAA" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Text="{TemplateBinding Content}" Visibility="Collapsed" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Opacity="0.5" Canvas.ZIndex="999999"/>
                            <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Opacity="0" Stroke="#FF6DBDD1" StrokeThickness="1"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="Controls:UpperTextBox">
            <Setter Property="FontFamily" Value="{StaticResource MainFont}"/>
            <Setter Property="FontSize" Value="{StaticResource MainFontSize}"/>
            <Setter Property="Foreground" Value="{StaticResource MainTextColor}"/>
            <Setter Property="BorderBrush" Value="{StaticResource LightTextColor}"/>
        </Style>
        <common:ByteArrayToImageConverter x:Name="ByteArrayToImageConverter" />
    </navigation:Page.Resources>
    <Grid x:Name="LayoutRoot" Margin="0,0,-95,0" Width="Auto" Height="620" RenderTransformOrigin="0.5,0.5"  >
        <Grid.RenderTransform>
            <CompositeTransform TranslateX="-358"/>
        </Grid.RenderTransform>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="936.714004516602"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="600"/>
        </Grid.RowDefinitions>
        <TextBlock x:Name="Title" Margin="358,10,440,0" TextWrapping="Wrap" Text="Incident" Style="{StaticResource TitleStyle}" FontFamily="Arial" VerticalAlignment="Top"/>
        <Rectangle x:Name="whiteBackground" Fill="White" Margin="359,101,-419,246" Width="997"/>
        <Rectangle x:Name="yellowBackground" Margin="358,354,-417,81" Style="{StaticResource YellowRectangleStyle}"/>
        <sdk:Label x:Name="claimLabel" HorizontalAlignment="Left" Margin="394,134,0,0" Content="Claim #" VerticalAlignment="Top" FontFamily="{StaticResource MainFont}" FontSize="14.667" Foreground="{StaticResource MainTextColor}" d:LayoutOverrides="HorizontalAlignment, VerticalAlignment"/>
        <TextBlock x:Name="claimBox" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Path=Model.ClaimNumber}" VerticalAlignment="Top" Margin="497,133,0,0" FontFamily="Arial" FontSize="{StaticResource MainFontSize}" Foreground="{StaticResource MainTextColor}" d:LayoutOverrides="VerticalAlignment" FontWeight="Bold"/>
        <sdk:Label x:Name="policyLabel" Margin="0,131,167,0" Content="Policy #" VerticalAlignment="Top" HorizontalAlignment="Right"/>
        <sdk:Label x:Name="policyText" HorizontalAlignment="Left" Margin="781,133,0,0" Content="{Binding Path=Model.PoliceReportNo}" Width="155" VerticalAlignment="Top" FontFamily="Arial" FontWeight="Bold"/>

        <sdk:Label x:Name="claimDateLabel" HorizontalAlignment="Left" Margin="394,164,0,0" Content="Claim Date" VerticalAlignment="Top" FontSize="14.667"/>
        <TextBox x:Name="claimDateBox" TextWrapping="Wrap" Text="{Binding Model.ClaimDate, Mode=TwoWay, UpdateSourceTrigger=Default}" Margin="0,160,-127,0" Height="28" VerticalAlignment="Top" HorizontalAlignment="Right" Width="570" FontFamily="Arial"/>
        <sdk:Label x:Name="nameLabel" HorizontalAlignment="Left" Margin="394,200,0,0" Content="Name" d:LayoutOverrides="HorizontalAlignment" VerticalAlignment="Top" FontSize="14.667"/>
        <TextBox x:Name="nameBox" TextWrapping="Wrap" Text="{Binding Model.InsuredFirstName, Mode=TwoWay}" Margin="0,197,-127,0" Height="28" VerticalAlignment="Top" d:LayoutOverrides="VerticalAlignment" HorizontalAlignment="Right" Width="571" FontFamily="Arial"/>
        <sdk:Label x:Name="addressLabel" HorizontalAlignment="Left" Margin="394,236,0,0" Content="Address" d:LayoutOverrides="HorizontalAlignment" VerticalAlignment="Top" FontSize="14.667"/>
        <TextBox x:Name="addressBox1" TextWrapping="Wrap" Text="{Binding Model.InsuredAddressLine1, Mode=TwoWay}" Margin="0,233,-127,0" BorderThickness="1,1,1,0" VerticalAlignment="Top" d:LayoutOverrides="VerticalAlignment" HorizontalAlignment="Right" Width="571" Height="37" FontFamily="Arial"/>
        <TextBox x:Name="addressBox2" TextWrapping="Wrap" Text="{Binding Model.InsuredAddressLine2, Mode=TwoWay}" Margin="0,269,-127,0" VerticalAlignment="Top" BorderThickness="1,0,1,1" HorizontalAlignment="Right" Width="571" d:LayoutOverrides="VerticalAlignment" FontFamily="Arial"/>
        <sdk:Label x:Name="cityLabel" HorizontalAlignment="Left" Margin="394,0,0,275" Content="City" d:LayoutOverrides="HorizontalAlignment" FontSize="14.667" Height="25" VerticalAlignment="Bottom"/>
        <TextBox x:Name="city" Text="{Binding Model.InsuredCity, Mode=TwoWay}" Margin="0,0,251,268" HorizontalAlignment="Right" Width="193" FontFamily="Arial" Height="28" VerticalAlignment="Bottom" d:LayoutOverrides="HorizontalMargin"/>
        <sdk:Label x:Name="stateLabel" Margin="741,0,0,273" Content="State" HorizontalAlignment="Left" FontSize="14.667" Height="25" VerticalAlignment="Bottom"/>





        <ComboBox x:Name="statesComboBox" Margin="0,304,2,0" VerticalAlignment="Top" HorizontalAlignment="Right" Width="154" FontFamily="Arial" Height="29" 
			        Template="{StaticResource ComboBoxControlTemplate2}"
        		    ItemsSource="{Binding States}" 
					SelectedValue="{Binding Model.InsuredState, Mode=TwoWay}"  
                    SelectedValuePath="StateCode" 
					/>

        
        
        <!--
                    ItemTemplate="{StaticResource StateComboBoxDataTemplate}" 
                    -->




        <sdk:Label x:Name="zipLabel" Margin="0,0,-60,273" Content="Zip" HorizontalAlignment="Right" Width="26" FontSize="14.667" Height="20" VerticalAlignment="Bottom"/>
        <TextBox x:Name="zipTextBox" Text="{Binding Model.InsuredZipCode, Mode=TwoWay}" Margin="0,0,-127,267" HorizontalAlignment="Right" FontFamily="Arial" Height="29" VerticalAlignment="Bottom" Width="60"/>
        <sdk:Label x:Name="vehicleLabel" Content="Vehicle" HorizontalAlignment="Left" Margin="393,372,0,0" VerticalAlignment="Top" d:LayoutOverrides="HorizontalAlignment" FontFamily="Segoe UI" FontSize="20" FontWeight="Bold"/>
        <sdk:Label x:Name="vinLabel" Content="VIN" Margin="0,410,443,0" VerticalAlignment="Top" FontSize="14.667" HorizontalAlignment="Right" MouseLeftButtonUp="vinLabel_MouseLeftButtonUp" />
      
        
        
        
        
        

        <!-- UpdateSourceTrigger.PropertyChanged -->
        <Controls:UpperTextBox x:Name="vinTextBox" Grid.Column="0" Grid.Row="0" Margin="0,0,250,163" ToolTipService.ToolTip="VIN=0B0FF3300Y" HorizontalAlignment="Right" Width="193" VerticalAlignment="Bottom" BorderBrush="{x:Null}"
            Text="{Binding Model.InsuredVIN, Mode=TwoWay, UpdateSourceTrigger=Default}"

        />


        
        
        
        
        
        
        
<!--
PropertyChanged
            Text="{Binding Model.InsuredVIN, Mode=TwoWay,
                        UpdateSourceTrigger=PropertyChanged}" 
TextChanged
            Text="{Binding Model.InsuredVIN, Mode=TwoWay}"
            TextChanged="vinTextBox_TextChanged" 
Reset
            Text="{Binding Model.InsuredVIN, Mode=TwoWay}"
-->




        
        <sdk:Label x:Name="colorLabel" Margin="0,0,157,168" Content="Color" VerticalAlignment="Bottom" d:LayoutOverrides="VerticalAlignment" HorizontalAlignment="Right" Width="53" FontSize="14.667"/>
        <TextBox x:Name="colorBox" Text="{Binding Model.InsuredColor, Mode=TwoWay}" Margin="0,0,2,163" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="154" BorderBrush="{x:Null}"/>
        <sdk:Label x:Name="yearLabel" Margin="0,449,444,0" Content="Year" VerticalAlignment="Top" FontSize="14.667" HorizontalAlignment="Right"/>

        <sdk:AutoCompleteBox x:Name="vehicleYearsAutoComplete" VerticalAlignment="Top" Margin="0,442,250,0" HorizontalAlignment="Right" Width="193" BorderBrush="{x:Null}" FilterMode="Contains"
                IsEnabled="{Binding IsYearsReady}"
                ItemsSource="{Binding Path=VinHelper.VehicleYears}" 
                SelectedItem="{Binding Path=Model.InsuredYear, Mode=TwoWay}" />


        <sdk:Label x:Name="makeLabel" HorizontalAlignment="Right" Content="Make" VerticalAlignment="Top" Margin="0,449,158,0" FontSize="14.667" Width="43"/>
        <sdk:AutoCompleteBox x:Name="vehicleMakeAutoComplete" VerticalAlignment="Top" Margin="0,444,2,0" HorizontalAlignment="Right" Width="154" BorderBrush="{x:Null}" BorderThickness="0" FilterMode="Contains"
        		ItemsSource="{Binding Path=VinHelper.VehicleMakes}"  IsEnabled="{Binding IsMakesReady}"
        		SelectedItem="{Binding Path=Model.InsuredMake, Mode=TwoWay}" />
        <Image Margin="0,129,-410,268" HorizontalAlignment="Right" Width="270" Source="{Binding Path=VinHelper.SelectedVehiclePhoto, Converter={StaticResource ByteArrayToImageConverter}}" />
        <sdk:Label x:Name="modelLabel" Content="Model" Margin="0,0,-97,129" VerticalAlignment="Bottom" FontSize="14.667" HorizontalAlignment="Right"/>
<!--
        <sdk:AutoCompleteBox x:Name="vehicleModelAutoComplete" VerticalAlignment="Bottom" Margin="0,0,-356,123" HorizontalAlignment="Right" Width="253" BorderBrush="{x:Null}" BorderThickness="0" 
        		ItemsSource="{Binding VehicleModels}"  IsEnabled="{Binding IsModelsReady}"
        		SelectedItem="{Binding Path=Model.InsuredModel, Mode=TwoWay}" />        
-->
        <!--<ComboBox x:Name="vehicleModelComboBox" VerticalAlignment="Bottom" Margin="0,0,-353,123" HorizontalAlignment="Right" Width="253" Template="{StaticResource ComboBoxControlTemplate1}"
        		ItemsSource="{Binding Path=VinHelper.VehicleModels}"   SelectionChanged="vehicleModelComboBox_SelectionChanged"
        		SelectedItem="{Binding Path=Model.InsuredModel, Mode=TwoWay}" Height="35"    />-->
        <sdk:AutoCompleteBox x:Name="vehicleModelComboBox" VerticalAlignment="Bottom" Margin="0,0,-353,123" HorizontalAlignment="Right" Width="253" 
        		ItemsSource="{Binding Path=VinHelper.VehicleModels}" SelectedItem="{Binding Path=Model.InsuredModel, Mode=TwoWay}" Height="35"    />

        <Grid  HorizontalAlignment="Right" Margin="0,0,-418,0" VerticalAlignment="Top" Height="101" Width="161" Background="{StaticResource YellowBrush}">
					<Grid.RowDefinitions>
						<RowDefinition Height="*" />
						<RowDefinition Height="*" />
					</Grid.RowDefinitions>
					<HyperlinkButton x:Name="damagesHyperlink"
					                 Grid.Row="0" FontSize="16" NavigateUri="/DamageView" Foreground="{StaticResource NavigationBackgroundColorBrush}" 
					                  Style="{StaticResource DamageButton}" FontFamily="Arial" >
						<Viewbox Margin="0, 5, 0, 5"    >
							<StackPanel Orientation="Horizontal" >
				                <TextBlock TextWrapping="Wrap" FontFamily="Arial" FontSize="16" Foreground="#FF6C5500" Margin="0 0 5 0" >
				                	<Run Text="Damage"/>
				                	<LineBreak/>
									<Run Text="Report"/>
								</TextBlock>
				                <Path Data="M91.787361,3.8064225 L111.54346,23.562525 L92.533142,42.572849" Stretch="Fill" Stroke="#FF6C5500" StrokeThickness="2" UseLayoutRounding="False" Width="10.117" Height="19.998" Canvas.Left="75.26"/>
							</StackPanel>
						</Viewbox>
			        </HyperlinkButton>
					<HyperlinkButton x:Name="damagesHyperlink2"
					                 Grid.Row="1" FontSize="16" Foreground="{StaticResource NavigationBackgroundColorBrush}" Command="{Binding SaveClaimCommand}"
					                  Style="{StaticResource DamageButton}" FontFamily="Arial"  >
						<Viewbox Margin="0, 5, 0, 5"    >
							<StackPanel Orientation="Horizontal" >
				                <TextBlock TextWrapping="Wrap" FontFamily="Arial" FontSize="16" Foreground="#FF6C5500" Margin="0 0 5 0" >
				                	<Run Text="Save"/>
				                	<LineBreak/>
									<Run Text="Claim"/>
								</TextBlock>
				                <!--<Path Data="M91.787361,3.8064225 L111.54346,23.562525 L92.533142,42.572849" Stretch="Fill" Stroke="#FF6C5500" StrokeThickness="2" UseLayoutRounding="False" Width="10.117" Height="19.998" Canvas.Left="75.26"/>-->
							</StackPanel>
						</Viewbox>
			        </HyperlinkButton>
					<!--<HyperlinkButton x:Name="saveClaimHyperlink"					
					                 Grid.Row="1" FontSize="16" NavigateUri="/DamageView" Foreground="{StaticResource NavigationBackgroundColorBrush}" 
					                  Style="{StaticResource DamageButton}" FontFamily="Arial"  >
						<Viewbox Margin="0, 5, 0, 5"  >
							<StackPanel Orientation="Horizontal" >
				                <TextBlock TextWrapping="Wrap" FontFamily="Arial" FontSize="16" Foreground="#FF6C5500"  Margin="0 0 5 0">
				                	<Run Text=" Save"/>
				                	<LineBreak/>
									<Run Text="Claim"/>
								</TextBlock>
				                <Path Data="M91.787361,3.8064225 L111.54346,23.562525 L92.533142,42.572849" Stretch="Fill" Stroke="#FF6C5500" StrokeThickness="2" UseLayoutRounding="False" Width="10.117" Height="19.998" Canvas.Left="75.26"/>
							</StackPanel>
						</Viewbox>
			        </HyperlinkButton>-->
				</Grid>
        
        <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top"/>
        <TextBox HorizontalAlignment="Right" Margin="0,0,-353,163" VerticalAlignment="Bottom" Width="253"
        	Text="{Binding Model.InsuredModel, Mode=TwoWay}" Visibility="Collapsed"  />
    </Grid>
</navigation:Page>
